﻿using System;
using System.Reflection;
using NLog;



namespace Crm2011.Framework.Connect
{
  static class Trace
  {
    public static readonly Logger Default = LogManager.GetLogger(typeof(Trace).Namespace);

   
    static Trace()
    {
      Default.Info("Assembly {0} v{1}", Assembly.GetExecutingAssembly().GetName().Name, Assembly.GetExecutingAssembly().GetName().Version);
    }

    public static void LogException(this Logger exceptionLogger, Exception exception)
    {
      exceptionLogger.Error(exception.InnerException == null ? exception.Message : exception.InnerException.Message);
    }
  }
}